const str: string;
const array: any[];
const readonlyArray: ReadonlyArray<any>;
const typedArray: UInt8Array;
const maybe: string;
const userDefined: {
  indexOf(x: any): number;
  includes(x: any): boolean;
};

str.indexOf(value) !== -1;
array.indexOf(value) !== -1;
readonlyArray.indexOf(value) === -1;
typedArray.indexOf(value) > -1;
maybe?.indexOf('') !== -1;
userDefined.indexOf(value) >= 0;

/example/.test(str);

function f1(a: string): void {
  a.indexOf(b) !== -1;
}

function f2(a: string): void {
  a.indexOf(b) != -1;
}

function f3(a: string): void {
  a.indexOf(b) > -1;
}

function f4(a: string): void {
  a.indexOf(b) >= 0;
}

function f5(a: string): void {
  a.indexOf(b) === -1;
}

function f6(a: string): void {
  a.indexOf(b) == -1;
}

function f7(a: string): void {
  a.indexOf(b) <= -1;
}

function f8(a: string): void {
  a.indexOf(b) < 0;
}

function f9(a?: string): void {
  a?.indexOf(b) === -1;
}


function f10(a: string): void {
  /bar/.test(a);
}

function f11(a: string): void {
  /bar/.test((1 + 1, a));
}

function f12(a: string): void {
  /\\0'\\\\\\n\\r\\v\\t\\f/.test(a);
}

const pattern = new RegExp('bar');
function f13(a: string): void {
  pattern.test(a);
}

const pattern = /bar/;
function f14(a: string, b: string): void {
  pattern.test(a + b);
}

function f15(a: any[]): void {
  a.indexOf(b) !== -1;
}

function f16(a: ReadonlyArray<any>): void {
  a.indexOf(b) !== -1;
}

function f17(a: Int8Array): void {
  a.indexOf(b) !== -1;
}

function f18(a: Int16Array): void {
  a.indexOf(b) !== -1;
}

function f19(a: Int32Array): void {
  a.indexOf(b) !== -1;
}

function f20(a: Uint8Array): void {
  a.indexOf(b) !== -1;
}

function f21(a: Uint16Array): void {
  a.indexOf(b) !== -1;
}

function f22(a: Uint32Array): void {
  a.indexOf(b) !== -1;
}

function f23(a: Float32Array): void {
  a.indexOf(b) !== -1;
}

function f24(a: Float64Array): void {
  a.indexOf(b) !== -1;
}

function f25<T>(a: T[] | ReadonlyArray<T>): void {
  a.indexOf(b) !== -1;
}

function f26<
T,
U extends
  | T[]
  | ReadonlyArray<T>
  | Int8Array
  | Uint8Array
  | Int16Array
  | Uint16Array
  | Int32Array
  | Uint32Array
  | Float32Array
  | Float64Array,
  >(a: U): void {
  a.indexOf(b) !== -1;
}

type UserDefined = {
  indexOf(x: any): number;
  includes(x: any): boolean;
};
function f27(a: UserDefined): void {
  a.indexOf(b) !== -1;
}

function f28(a: Readonly<any[]>): void {
  a.indexOf(b) !== -1;
}